import axios from './axios'
import qs from 'qs'
import {apiUrl} from '@/config/config'

export const getFirstBuildList = (data) => {
    return new Promise((resolve, reject) => {
        axios({
            url: apiUrl + '/building-manager/buildingDevice/api/getBuildingMonitors',
            method: 'post',
            data: qs.stringify(data)
        }).then(res => {
            resolve(res.data)
        })
    })
}

export const getBuildList = (data) => {
    return new Promise((resolve, reject) => {
        axios({
            url: apiUrl + '/building-manager/buildingDevice/api/getBuildingDetailMonitors',
            method: 'post',
            data: qs.stringify(data)
        }).then(res => {
            resolve(res.data)
        })
    })
}

export const beat = (params) => {
    return new Promise((resolve, reject) => {
        axios.noLoading = true
        axios({
            url: apiUrl + '/video-streaming/video/heartbeat',
            method: 'get',
            params
        }).then(res => {
            resolve(res.data)
        })
    })
}